package com.htrq.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.htrq.dao.UserDao;
import com.htrq.entity.Page;
import com.htrq.entity.User;
import com.htrq.util.Md5cUtil;

@Service
@Transactional(value="txManager")
public class UserService {
	@Resource
	private UserDao userDao;

	public List<User> getAlluser(User user, Page page) {
		return userDao.getAlluser(user, page);
	}
	public boolean saveuser(User user) {
		try {
			String str="123456";
			user.setUpwd(Md5cUtil.encoderByMd5(str));
			userDao.saveuser(user);
			return true;
		} catch (Exception e) {
			return false;
		}
	}
	public Long getTotal() {
		return userDao.getTotal();
	}
}
